    <link rel="stylesheet" href="../addons/jy_yousetli/resource/css/base.css">
    <link rel="stylesheet" href="../addons/jy_yousetli/resource/css/style.css">
    <script type="text/javascript" src="../addons/jy_yousetli/resource/js/jquery-2.1.1.min.js"></script>
    <script>
/**
 * Created by tanytree on 2015/10/20.
 */

$(function(){
    $(".otherUser .bd .desc>a.arrowa").on("click",function(){
        $(this).toggleClass('on');
        $(this).parent().parent().parent().find(".subInfo").slideToggle();
    });
});
//窗口处理
$(function(){
$(".aRule").on('click',function(){
    rule();
});
    //login();
});

//规则窗口
function rule(){
    setWindow.centerWindow('.wRule');
    $(".fullBg").fadeIn();
    $(".wRule").fadeIn();
}
function direction(){
    setWindow.centerWindow('.direction');
    $(".fullBg").fadeIn();
    $(".direction").fadeIn();
}
Date.prototype.Format = function (fmt) { //author: meizz 
    var o = {
        "M+": this.getMonth() + 1, //月份 
        "d+": this.getDate(), //日 
        "h+": this.getHours(), //小时 
        "m+": this.getMinutes(), //分 
        "s+": this.getSeconds(), //秒 
        "q+": Math.floor((this.getMonth() + 3) / 3), //季度 
        "S": this.getMilliseconds() //毫秒 
    };
    if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
    for (var k in o)
    if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
    return fmt;
}
var setWindow = {
    //1.居中方法，传入需要剧中的标签
    center: function(a) {
        var wWidth = $(window).width();
        var wHeight = $(window).height();
        var boxWidth = $(a).outerWidth(true);
        var boxHeight = $(a).height();
        var scrollTop = $(window).scrollTop();
        var scrollLeft = $(window).scrollLeft();
        var top = scrollTop + (wHeight - boxHeight) / 2;
        var left = scrollLeft + (wWidth - boxWidth) / 2;
        $(a).css({"top": top, "left": left});
    },
    //2.将盒子方法放入这个方，方便法统一调用
    centerWindow: function(a) {
        setWindow.center(a);
        //自适应窗口
        $(window).bind('scroll resize', function() {
            setWindow.center(a);
        });
    },
    //3.点击弹窗方法
    clickaShowWindow: function(a, b) {
        $(b).click(function() {
            setWindow.centerWindow(a);
            $(".fullBg").show();
            $(a).slideDown(300);
            return false;
        });
    },
    xClosed:function(){
        $(".fullBg").hide();
        $(".window").hide();
        $(".flagPosition").removeClass("hidden");
        $(".userWord ").css('visibility','visible');
    },
    closedWindow:function(){
        var timer=null;
        timer=setTimeout(function(){
            $(".fullBg").hide();$(".window").hide();
        },4000);
    },
    windowClosed:function(){
        $(".fullBg").hide();
        $(".window").hide();
    }
};
(function timeShow(){
    var show_time = $(".timeShow");
    var auto=null;
    endtime = scope.pagedata.act.endtime*1000;//结束时间
    today = new Date();//当前时间
    delta_T =endtime-today;//时间间隔
    if(delta_T < 0){
        clearInterval(auto);
      //  location.reload();
        return;
    }
    auto=window.setTimeout(timeShow,1000);
    total_days = delta_T/(24*60*60*1000);//总天数
    total_show = Math.floor(total_days);//实际显示的天数
    total_hours = (total_days - total_show)*24;//剩余小时
    hours_show = Math.floor(total_hours);//实际显示的小时数
    total_minutes = (total_hours - hours_show)*60;//剩余的分钟数
    minutes_show = Math.floor(total_minutes);//实际显示的分钟数
    total_seconds = (total_minutes - minutes_show)*60;//剩余的分钟数
    seconds_show = Math.floor(total_seconds);//实际显示的秒数
    if(total_days<10){
        total_days="0"+total_days;
    }
    if(hours_show<10){
        hours_show="0"+hours_show;
    }
    if(minutes_show<10){
        minutes_show="0"+minutes_show;
    }
    if(seconds_show<10){
        seconds_show="0"+seconds_show;
    }
    show_time.find("li").eq(0).text(total_show);//显示在页面上
    show_time.find("li").eq(2).text(hours_show);
    show_time.find("li").eq(4).text(minutes_show);
    show_time.find("li").eq(6).text(seconds_show);
})();

function share(){
	$('.share_bg').show();
	$('.share_bg').click(function(){
		if($(this).css('display') == 'block'){
			$(this).css('display','none');
		}
	});
}
</script>
  {{ifelse(pagedata.memberNotice,pagedata.memberNotice,'')}}

<section class="banner">
    <img src="{{tomedia(pagedata.act.bg1)}}" class="bn" alt="bn" style="width: 100%;" />
    <img src="{{tomedia(pagedata.act.bg2)}}" class="bannertit" alt="bannertit" height="78.5"/>
    <!-- <img src="{weimicms:$info.bg3}" class="yellowtit" alt="yellowtit" height="50"/> -->
    <section class="boom oTime">
        <img src="../addons/jy_yousetli/resource/images/boom.png" alt="boom"/>
            <div class="timeBox">
                <h2 ng-if="pagedata.is_over==1"> 距离开始还剩</h2>
                <h2 ng-if="pagedata.is_over==0"> 时间还剩</h2>
                <h2 ng-if="pagedata.is_over>1"> 活动结束</h2>
                <ul class="timeShow">
                    <li class="bg">00</li>
                    <li class="oText">天</li>
                    <li class="bg">00</li>
                    <li class="oText">时</li>
                    <li class="bg">00</li>
                    <li class="oText">分</li>
                    <li class="bg">00</li>
                    <li class="oText">秒</li>
                </ul>
            </div>
    </section>
    <a class="aRule"></a>
</section>
<section class="coupon">
    <div class="fl">
        <div class="avatar">
            
            <img ng-src="{{pagedata.member.avatar || '../addons/jy_yousetli/resource/images/portrait.jpg'}}" alt="avatar">
            <h2>
			{{ifelse(pagedata.member.nickname,pagedata.member.nickname,'匿名')}}
            </h2>
        </div>
        <p class="endTime">有效期:{{pagedata.act.endtimestr}}止</p>

    </div>
    <div class="rightPart mt20">
        <div class="limit"><i></i>
		<em ng-if="pagedata.share_key=='' && pagedata.user.state != 1" style="font-size: 2.5rem;">￥{{pagedata.player.money || 0.00}} </em> 
		<em ng-if="pagedata.share_key!='' || pagedata.user.state == 1" style="font-size: 2.5rem;">￥{{pagedata.player.money || 0.00}} </em>
		</div>
        <p><a href="javascript:direction();">点此查看优惠说明</a></p>
		<p ng-if="pagedata.user.state != 1">接力越多，抵扣越多</p>
		
        <div ng-if="!pagedata.help_mid" class="code"><a href="javascript:;" ng-click="access_json('jy_yousetli/exchange//actid='+pagedata.act.id)">前往兑换优惠券</a></div>
	
		<div ng-if="pagedata.share_key != ''" class="limit"><i>￥</i><em style="font-size: 5rem;">{{pagedata.sum}}</em></div>
		<p>快去玩游戏，赚取优惠吧</p>
    </div>

</section>
<section class="coupon" ng-if="pagedata.discount_type==2">
    <div class="fl">
        <div class="avatar">
           <img ng-src="{{member.avatar || '../addons/jy_yousetli/resource/images/portrait.jpg'}}" alt="avatar">
            <h2>
               {{ifelse(pagedata.member.nickname,pagedata.member.nickname,'匿名')}}
            </h2>
        </div>
        <p class="endTime">有效期:{{pagedata.act.endtimestr}}止</p>

    </div>
    <div class="rightPart mt20">
        <div ng-if="pagedata.helps_sum!=0" class="cut" style="font-size: 4.5rem;">
            {{10-pagedata.helps_sum<pagedata.act.discount_min?pagedata.act.discount_min:10-pagedata.helps_sum}}<i>折</i>
			<p class="endTime">最高可优惠到{{pagedata.info.discount_min}}折</p>
        </div>
		<div ng-if="pagedata.share_key==''" class="code">兑换码<em>{{pagedata.user.state != 1?'已使用':'10000000'+pagedata.user.id}}</em></div>
		<div ng-if="pagedata.helps_sum==0" class="cut" style="font-size: 5rem;">
			{{10-pagedata.helps_sum<pagedata.act.discount_min?pagedata.act.discount_min:10-pagedata.helps_sum}}<i>折</i>
		</div>
		<p>快去玩游戏，赚取优惠吧</p>
    </div>

</section>

<section ng-if="pagedata.user.state != 1 && pagedata.share_key==''" class="tip tc mb20">
    <img src="../addons/jy_yousetli/resource/images/tip.png" alt="tip" height="120" />
</section>

<section class="aBtn">
	<a ng-if="pagedata.zhuangtai !=2">{{pagedata.zhuangtai==1?'未开始':'已结束'}}</a>
	<a ng-if="pagedata.memberNotice && pagedata.basic.sms==1" href="javascript:login();">{{pagedata.cishu_text}}</a>
	<a href="javascript:;" ng-click="access_json('jy_yousetli/game//id='+pagedata.act.id+'&help_mid='+pagedata.help_mid)">{{pagedata.cishu_text}}</a>
	<a href="javascript:share();">邀请好友帮{{pagedata.wota}}抢优惠</a>

</section>

<section ng-if="pagedata.player.play_times <1" class="noData">
    <img src="../addons/jy_yousetli/resource/images/nodata.png" alt="nodata">
</section>

<section ng-if="pagedata.player.play_times >=1" class="otherUser">
    <div class="hd">
        <div class="tit">
            <h2>抢优惠</h2>
        </div>
        <div class="line">
            <i class="fr"></i>
            <i class="fl"></i>
            <div class="lineThis"></div>
        </div>
    </div>
    <div class="bd">
        <ul>
			<volist name="helps" id="hv">
            <li ng-repeat="(no,data) in pagedata.helpdata">
                <div class="liwrap">
                    <div class="clearfix">
                        <div class="userAvatar fl">
                           <img ng-src="{{data.avatar || '../addons/jy_yousetli/resource/images/portrait.jpg'}}">
                        </div>
                        <div class="desc">
                            <h3>{{ifelse(data.nickname,data.nickname,'匿名')}}</h3>
                            <p class="money">{{data.money}}<i>元</i></p>
                            <p class="tipText">玩了{{data.play_times}}次</p>
                            <!-- <a class="texta" style="right:13%" href="">帮TA抢优惠</a> -->
                            <a class="arrowa" href="javascript:;">
                            </a>
                        </div>
                    </div>
                    <div class="subInfo">
                        <ol>
                            <li ng-repeat="item in data.xiangqing">
                                <span style="width:23%">抢到优惠</span>
                                <span style="width:37%">{{item}}元</span>
                                <span></span>
                            </li>
                        </ol>
                    </div>
                </div>
                <div class="no">
                    <i>{{no+1}}</i>
                </div>

            </li>
            </volist>
        </ul>
    </div>
</section>
<a ng-if="pagedata.help_mid>0" class="backTo" href="javascript:;" ng-click="access_json('jy_yousetli/detail//id='+pagedata.act.id)"><i>我要优惠</i></a>

<div class="fullBg"></div>
<div class="window oLogin">
    <div class="windowThis">
        <div class="bd">
            <div class="adMargin">
                <div class="row">
                    <div class="putBorder"> <i></i>
                        <input type="text" placeholder="手机号" value="" name='tel'>
                    </div>
                </div>
                <div class="row">
                    <div class="putBorder"> <a href="javascript:;" class="getCode">获取验证码</a> <i></i>
                        <input type="text" placeholder="验证码" value="" name='code'>
                    </div>
                </div>
                <div class="row">
                    <button id="telyzbut">确定</button>
                </div>
            </div>
            <a href="javascript:;" onClick="setWindow.windowClosed()" class="oClosed"></a> </div>
    </div>
</div>

<div class="window wRule">
    <div class="addPad" style="height: 280px;overflow: auto;">
        <h2>活动规则</h2>
       {{pagedata.act.content}}
    </div>
    <a class="xClosed" href="javascript:;" onclick="setWindow.windowClosed()"></a>
</div>
<style>
.direction{width: 290px;border: 5px solid rgba(46,37,79,.8);border-radius: 5px;background:#463870 url("../addons/jy_yousetli/resource/images/ball.png") no-repeat left bottom; background-size:50px 50px;color: #fff}
.direction .addPad{padding: 15px 20px 50px 20px;background: url("../addons/jy_yousetli/resource/images/rulebg.png") repeat top center;}
.direction h2{color: #ffde20;font-size: 16px;font-weight: normal}
.direction p{padding-top: 15px;}
.direction .xClosed,.oLogin .oClosed {position: absolute;top:-12px;right:-12px;width: 20px;height: 20px;background:#ffea73 url("../addons/jy_yousetli/resource/images/xclosed.png") center center no-repeat;background-size: 15px 15px;border-radius: 100%;padding: 5px; }
</style>
<div class="window direction">
    <div class="addPad">
        <h2>优惠说明</h2>
        <volist name='direction' id="div">
		
		{{ifelse(pagedata.div.discount!=0,'消费满'+pagedata.div.at_least+'元可以抵'+pagedata.div.discount+'元优惠','消费满'+pagedata.div.at_least+'元可无上限抵用')}}<br/>
	
		</volist>
		<br/>
		注意：本券仅可使用一次，抵现金额请参照以上范围，超出部分不计入下次使用
    </div>
    <a class="xClosed" href="javascript:;" onclick="setWindow.windowClosed()"></a>
</div>

<div class="share_bg" style="display: none;position: fixed;top: 0;left: 0;width: 100%;height: 100%;text-align: center;background: rgba(0,0,0,0.7);z-index: 99;">
    <img src="../addons/jy_yousetli/resource/images/share-guide.png">
</div>
<style>
.tips{width: 100%;position: fixed;top: 0;left: 0;display: none;z-index: 999999}
.tips h3{width: 70%;padding: 10px 0;  margin: 0 auto;  background: rgba(255,255,255,1);  text-align: center;  font-size: 1.2rem; color: red;}
</style>
<div class="tips" style="display: none;"><h3></h3></div>
<script>
function alert(text){
	var t=null;
	clearTimeout(t);
	var tip= $(".tips");
	tip.find('h3').text(text);
	tip.slideDown();
	t=setTimeout(function(){ tip.slideUp()},3000);
}
</script>
<!-- php

$helps_sum = $helps_sum?$helps_sum:0;
if($info['discount_type']==1){
	$youhuizhi = $helps_sum.'元';
}else{
	$youhuizhi = (10 - $helps_sum)<$info['discount_min']?$info['discount_min']:(10 - $helps_sum);
	$youhuizhi = $youhuizhi.'折';
}
?>
-->

</script>
{{pagedata.shareScript}}
</body>
</html>